<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1" import="java.sql.*"%>
	<%@page import="org.hibernate.Session"%>
<%
	
	String userName = request.getParameter("userName");
	String password = request.getParameter("password");
	String displayName = request.getParameter("displayName");
	try{
		User user = new User(userName,password,displayName);
		UserManager manager= new UserManager();
		manager.insertUser(user);
		
		//===========
		AccountBank accountBank = new AccountBank();
		accountBank.setUserName(userName);
		accountBank.setTotalMoney(1000000);
		AccountBankManager accountBankManager = new AccountBankManager();
		accountBankManager.saveAccountBank(accountBank);
 	}catch(Exception e){
		System.out.println("Insert error");
		e.printStackTrace();
	}
		
%>


<%@page import="storeMovie.Util.SessionFactoryUtil"%>
<%@page import="storeMovie.JavaBean.User"%>
<%@page import="storeMovie.Util.UserManager"%>
<%@page import="storeMovie.JavaBean.AccountBank"%>
<%@page import="storeMovie.Util.AccountBankManager"%><html>
<head>
<title></title>
<script type="text/javascript">
	function load()
	{
		window.location = "Main.jsp";
	}
</script>
</head>
<body onload="setTimeout('load()', 2000)">
<h1 style="text-align: center;">Register successful</h1>
<h2 style="text-align: center;">Prepare to be redirected!</h2>
<h2 style="text-align: center;">This page is a time delay redirect</h2>


</body>
</html>